{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Load Library"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#!/bin/python3\n",
    "import ctypes\n",
    "from ctypes import *\n",
    "import numpy as np\n",
    "import time\n",
    "import cv2 as cv\n",
    "from matplotlib import pyplot as plt\n",
    "from libqhy import *\n",
    "qhyccd = CDLL('/usr/local/lib/libqhyccd.so')\n",
    "qhyccd.GetQHYCCDParam.restype=c_double\n",
    "qhyccd.OpenQHYCCD.restype=ctypes.POINTER(c_uint32)\n",
    "# ref: https://www.qhyccd.com/bbs/index.php?topic=6356.0\n",
    "# H.F. @20191115"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "b'QHY163M-8cf4dc43a8fe4f8f'\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ret = -1\n",
    "qhyccd.InitQHYCCDResource()\n",
    "qhyccd.ScanQHYCCD()\n",
    "type_char_array_32 = c_char*32\n",
    "id=type_char_array_32()\n",
    "qhyccd.GetQHYCCDId(c_int(0), id)    # open the first camera\n",
    "print(id.value)\n",
    "cam = qhyccd.OpenQHYCCD(id)\n",
    "qhyccd.SetQHYCCDStreamMode(cam, 0)  # 0 for single frame\n",
    "qhyccd.InitQHYCCD(cam)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Get Camera Parameters\n",
    "chipw = c_double()\n",
    "chiph = c_double()\n",
    "w = c_uint()\n",
    "h = c_uint()\n",
    "pixelw = c_double()\n",
    "pixelh = c_double() \n",
    "bpp = c_uint()\n",
    "channels = c_uint32(1)\n",
    "qhyccd.GetQHYCCDChipInfo(cam, byref(chipw), byref(chiph), byref(w), byref(h),\n",
    "                         byref(pixelw), byref(pixelh), byref(bpp))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f506b3192e8>"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQgAAAD8CAYAAACLgjpEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO29e8wsx3Un9jvVPTPf+3GfvC+KlyIpmaKsh2mJjo1dR1rJlDYIbcBZaAOsCUcIN1kLsYFNENkLxLt2HNiB18YacbSgY8V04LWstb0xo8hRKFle2/HqQUqUSImieHlJivfyvr/3a2a66+SPquqp7un39Mz0fHd+wHfvTHdPVXV31a9OnToPYmZMMcUUU8RBjLsBU0wxRX0xJYgpppgiEVOCmGKKKRIxJYgpppgiEVOCmGKKKRIxJYgpppgiESMnCCJ6mIheJKILRPTxUdc/xRRT5AeN0g6CiBwA3wXwAQCXAHwVwD9k5m+PrBFTTDFFboxagngPgAvMfJGZOwA+BeCREbdhiimmyAl3xPWdAfC69f0SgPfaFxDRYwAeAwAHzg/MYWl0rTssoOAfEBFABFiSIksZuT58forbD9tYv8nMx6PHR00QmWDmxwE8DgBLdITfS+8fc4vGBCKQ21AfGy7k/j5AAiQIYmEeaLXAm1tgzwNLBjXUq+SuBxIEcl2w5wGkhET2fVUuS4C4ry5gShC3Mz7Pf/xa3PFRE8RlAOes72f1sdsDRMEgNwMXejADAHe6agADINcFLcwDvgQEAXt7ACRYCnVdpwtprmcGd7RUw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wLwbv15EcB3Adx/G9w3AVjQnxsAvqzv59MAPqKP/2sA/7X+/E8A/Gv9+SMA/kh/vl/3/RaA83pMOKO8l7pKEO8BcIGZLzJzB8CnoJzAJhbM/FcAonYfjwB4Qn9+AsrgzBwfvsPbkMHMV5j5a/rzNoAXoPxvDvt9M8c7OL4PgPF+jt63eR5/DOD92gDxEQCfYuY2M78CZVv0nhHcQoC6EkQux65DgJPMfEV/vgrgpP48kMNbHaHF5ndBzaaH/r6jDo5Qs/8GM5ugmPY9BPenz28COIoa3HddCeK2AyuZ8lDuORPRAoA/AfBzzBwK8XxY75sjDo5Qjo0Th7oSRJLD12HDNS1CQ/9/XR9Pc3ibqOeigwz9CYA/YOY/1YcP/X0bMPMGgC8C+CGoJZNxb7DvIbg/fX4ZwC3U4L7rShBfBXCv1vo2oRQ3T465TcPAkwCMRv5RAH9mHf8prdV/CNrhDcDnAHyQiFa15v+D+lgtodfRvwvgBWb+DevUYb/v40S0oj8bB8cXoIjiJ/Vl0fs2z+MnAfyFlqyeBPARvctxHipK21dGcxca49b4pmiCPwyl9X4ZwD8bd3squJ8/BHAFQBdqLflRqHXmFwC8BODzAI5wTwv+2/renwPwoFXOfwGlrLoA4KfHfV8Z9/wjUMuHb0I59D2r3+thv+/vB/B1fd/PA/gf9PG7oQb4BQD/FkBLH5/R3y/o83dbZf0z/TxeBPChUd/L1NR6iimmSERdlxhTTDFFDTAliCmmmCIRU4KYYoopEjEliCmmmCIRU4KYYoopEjEliCmmmCIRU4KYYoopEvH/AxCuVVDVoOq6AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "roi_w = c_uint(3532)\n",
    "roi_h = c_uint(3522)\n",
    "\n",
    "imgdata = (ctypes.c_uint16 * roi_w.value * roi_h.value)()\n",
    "qhyccd.SetQHYCCDResolution(cam, 0, 0, roi_w, roi_h)\n",
    "qhyccd.SetQHYCCDParam(cam, CONTROL_ID.CONTROL_EXPOSURE, c_double(90000)) # unit: us\n",
    "qhyccd.SetQHYCCDParam(cam, CONTROL_ID.CONTROL_GAIN, c_double(100))\n",
    "\n",
    "ret = qhyccd.ExpQHYCCDSingleFrame(cam)\n",
    "ret = qhyccd.GetQHYCCDSingleFrame(\n",
    "    cam, byref(roi_w), byref(roi_h), byref(bpp), byref(channels), imgdata)\n",
    "x = np.asarray(imgdata)\n",
    "plt.imshow(x)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
